package com.hmaill.fegin;

import com.hmaill.common.dto.PageDTO;
import com.hmaill.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "itemservice")
public interface ItemClient {
    /**
     * 分页查询item
     * @param page
     * @param size
     * @return
     */
    @GetMapping("item/list")
    public PageDTO<Item> getList(@RequestParam(value = "page", defaultValue = "1") Integer page,
                                 @RequestParam(value = "size", defaultValue = "5") Integer size);

    /**
     * 通过id查询item
     * @param id
     * @return
     */
    @GetMapping("item/{id}")
    public Item searchItem(@PathVariable Long id);
}
